package com.google.code.expr.lang;

import com.google.code.expr.runtime.EXPRRunTimeState;
import com.google.code.expr.runtime.EXPRValue;

public class EXPRConstString extends EXPRConst {
	private EXPRValue mString;
	
	public EXPRConstString(String pString) {
		if (pString!=null) {
			if (pString.startsWith("\"")) pString = pString.substring(1);
			if (pString.endsWith("\"")) pString = pString.substring(0,pString.length()-1);
		}
		mString = new EXPRValue(pString);
		
	}

	public String toString() {
		return mString.toString();
	}

	@Override
	public String resolveToString(EXPRRunTimeState pState) {
		return mString.getString();
	}

	@Override
	public EXPRValue resolveToValue(EXPRRunTimeState pState) {
		return mString;
	}
	

}
